﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _Sieci_Email_Klient
{
    public partial class NewMessage : Form
    {
        public string[] Recepients;
        public string Recepient;
        public string Subject = "";
        public string Message = "";

        public NewMessage()
        {
            InitializeComponent();
        }

        public NewMessage(string to)
        {
            InitializeComponent();
            toTextBox.Text = to;
        }

        private void sendButton_Click(object sender, EventArgs e)
        {
            if (toTextBox.Text != "")
            {
                Recepients = toTextBox.Text.Split(new Char[] { ';', ' ', ',' });
                Subject = subjectTextBox.Text;
                Message = messageRichTextBox.Text;
                DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("No Recepient specified");
            }
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
    }
}
